import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {AreaVO, ProvinceQuery, ProvinceVO} from "@/api/kitchen/area/province/types";
import {CityQuery, CityVO} from "@/api/kitchen/area/city/types";
import {DistrictQuery, DistrictVO} from "@/api/kitchen/area/district/types";

export const listProvince = (query?: ProvinceQuery): AxiosPromise<ProvinceVO[]> =>  {
  return request({
    url: '/kitchen/area/listProv',
    method: 'get',
    params: query
  })
}
export const listProvinceNoPage = (query?: ProvinceQuery): AxiosPromise<ProvinceVO[]> => {
  return request({
    url: '/kitchen/area/listProvNoPage',
    method: 'get',
    params: query
  })
}


export const listCity = (query?: CityQuery): AxiosPromise<CityVO[]> => {
  return request({
    url: '/kitchen/area/listCity',
    method: 'get',
    params: query
  })
}
export const listCityPage = (query?: CityQuery): AxiosPromise<CityVO[]> => {
  return request({
    url: '/kitchen/area/listCityPage',
    method: 'get',
    params: query
  })
}


export const listAllArea = (query?: ProvinceQuery): AxiosPromise<AreaVO[]> =>  {
  return request({
    url: '/kitchen/area/getAllArea',
    method: 'get',
    params: query
  })
}

export const listDistrictPage = (query?: DistrictQuery) : AxiosPromise<DistrictVO[]> =>{
  return request({
    url: '/kitchen/area/listDistrictPage',
    method: 'get',
    params: query
  })
}


export const listDistrict = (query?: DistrictQuery): AxiosPromise<DistrictVO[]> => {
  return request({
    url: '/kitchen/area/listDistrict',
    method: 'get',
    params: query
  })
}
